import requests
from common.config import Config

base_url = Config().get_server("base_url")


class Request:
    def __init__(self):
        self.headers = {"Content-Type": "application/json"}

    def get(self, interface):
        return requests.get(base_url + interface, headers=self.headers)

    def post(self, interface, json):
        return requests.post(url=base_url + interface, json=json, headers=self.headers)

    def put(self, interface, data):
        return requests.put(url=base_url + interface, data=data)

    def delete(self, interface):
        return requests.delete(url=base_url + interface)
